package practise.sort.SortAlgrothim;

/**
 * Created by richard on 5/11/14.
 */
public class BubbleSort extends SortUtil {
    static public int[] sort(int[] arrays){
        int[] clone = arrays.clone();

        for(int i=0 ; i < clone.length; i++){
            for(int j =0 ; j< clone.length-1; j++){
                if(clone[j]>clone[j+1]){
                    swap(clone,j,j+1);
                }
            }
        }
        return clone;
    }

}
